﻿using System;
using StudentManagementConsole.Data;

namespace StudentManagementConsole
{
    class Program
    {
        static void Main()
        {
            Console.WriteLine("学校管理控制台");
            DatabaseHelper.Init();
            while (true)
            {
                Console.WriteLine("1. 添加学校  2. 列出学校  3. 查看日志  0. 退出");
                var c = Console.ReadLine(); if (c == "0") break;
                if (c == "1") { Console.Write("学校名称: "); var n = Console.ReadLine(); DatabaseHelper.AddSchool(n); }
                else if (c == "2") { var list = DatabaseHelper.GetSchools(); foreach (var s in list) Console.WriteLine($"[{s.Id}] {s.Name}"); }
                else if (c == "3") { var logs = DatabaseHelper.GetLogs(); foreach (var l in logs) Console.WriteLine($"[{l.Timestamp}] {l.Operation}"); }
            }
        }
    }
}
